package game;

import java.util.Random;

public class SeaObject {
    protected int width;  //宽
    protected int height; //高
    protected int x;      //x坐标
    protected int y;      //y坐标
    protected int speed;  //移动速度
    public SeaObject(int width,int height){
        this.width=width;
        this.height=height;
        x = -width; //负的潜艇的宽
        Random rand = new Random(); //随机数对象
        y = rand.nextInt(479-height-150+1)+150; //150到(窗口高-潜艇高)之间的随机数
        speed = rand.nextInt(3)+1; //1到3之内的随机数
    }

    public SeaObject(int width,int height,int x,int y,int speed) {
        this.width=width;
        this.height=height;
        this.x=x;
        this.y=y;
        this.speed=speed;
    }

    public void move(){
        System.out.println("海洋对象移动啦!");
    }
}
